load("@rules_java//java:defs.bzl", "java_library")

package(
    default_applicable_licenses = ["//:license"],
    default_visibility = [
        "//optimizer:__pkg__",
        "//publish:__pkg__",
    ],
)

java_library(
    name = "optimizer",
    srcs = [
        "CelOptimizerFactory.java",
    ],
    tags = [
    ],
    deps = [
        ":optimizer_impl",
        "//bundle:cel",
        "//checker:checker_builder",
        "//compiler",
        "//compiler:compiler_builder",
        "//optimizer:optimizer_builder",
        "//parser:parser_builder",
        "//runtime",
    ],
)

java_library(
    name = "optimizer_builder",
    srcs = [
        "CelOptimizer.java",
        "CelOptimizerBuilder.java",
    ],
    tags = [
    ],
    deps = [
        ":ast_optimizer",
        ":optimization_exception",
        "//common:cel_ast",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "optimizer_impl",
    srcs = [
        "CelOptimizerImpl.java",
    ],
    tags = [
    ],
    deps = [
        ":ast_optimizer",
        ":optimization_exception",
        ":optimizer_builder",
        "//bundle:cel",
        "//common:cel_ast",
        "//common:compiler_common",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "ast_optimizer",
    srcs = ["CelAstOptimizer.java"],
    tags = [
    ],
    deps = [
        ":optimization_exception",
        "//:auto_value",
        "//bundle:cel",
        "//common:cel_ast",
        "//common:compiler_common",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "mutable_ast",
    srcs = [
        "AstMutator.java",
        "MutableExprVisitor.java",
    ],
    tags = [
    ],
    deps = [
        "//:auto_value",
        "//common:cel_ast",
        "//common:mutable_ast",
        "//common:mutable_source",
        "//common/annotations",
        "//common/ast",
        "//common/ast:expr_factory",
        "//common/ast:mutable_expr",
        "//common/navigation:common",
        "//common/navigation:mutable_navigation",
        "//common/types:type_providers",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "optimization_exception",
    srcs = ["CelOptimizationException.java"],
    tags = [
    ],
)
